<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var arr = [15, 684, 684, 352186, 32165, 4784, 32165, 488, 626, 498]
        Array.prototype.Myfn = function(callback) {
                var ret = [];
                for (i = 0; i < arr.length; i++) {
                    var flog = callback(arr[i]);
                    if (flog) {
                        ret.push(arr[i])
                    }
                }
                return ret
            }
            // 高阶函数 ： 函数内部形参为函数的函数 
        console.log(arr.Myfn(function(n) {
            return n < 5000
        }))
    </script>
</body>

</html>